#include <iostream>
#include <vector>
#include <list>

using namespace std;

template <typename IteratorType, typename elemType>
IteratorType
find(IteratorType first, IteratorType last, const elemType &value)
{
    for (; first != last; ++first)
        if (value == *first)
            return first;
    return last;
}

int main()
{
    vector<double> vec = {452.12, 4514.15, 482.454, 15.54, 8815.5, 55256.154};
    vector<double>::iterator first = vec.begin();
    vector<double>::iterator last = vec.end();

    cout << *find(first, last, 15.54) << endl;

    int array[] = {45, 544, 7455, 58, 24, 48};
    cout << *find(array, array + 6, 45) << endl;

    list<int> ilist = {425, 454, 58, 185, 78, 578};
    cout << *find(ilist.begin(), ilist.end(), 58) << endl;

    for (int i = 0; i < (int)vec.size(); i++)
        cout << &vec[i] << ' ';

    cout <<endl << vec.empty();
}